package com.gs.weather.service.impl;


import com.gs.weather.dao.DisasterSubtypeStrengthDao;
import com.gs.weather.entity.DisasterSubtypeStrength;
import com.gs.weather.service.DisasterSubtypeStrengthService;
import com.gs.weather.utils.HttpUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;

/**
 * Created with IntelliJ IDEA.
 * User: Legolas
 * Date: 2017/9/21 0021
 */
@Service
public class DisasterSubtypeStrengthServiceImpl implements DisasterSubtypeStrengthService{

    @Autowired
    DisasterSubtypeStrengthDao disasterSubtypeStrengthDao;

    @Override
    public ResponseEntity addStrength(DisasterSubtypeStrength disasterSubtypeStrength) {
        disasterSubtypeStrengthDao.addStrength(disasterSubtypeStrength);
        return HttpUtils.buildStringResponse("OK", HttpStatus.OK);
    }

    @Override
    public ResponseEntity updateStrength(DisasterSubtypeStrength disasterSubtypeStrength) {
        disasterSubtypeStrengthDao.updateStrength(disasterSubtypeStrength);
        return HttpUtils.buildStringResponse("OK", HttpStatus.OK);
    }

    @Override
    public ResponseEntity deleteStrength(int id) {
        disasterSubtypeStrengthDao.deleteStrength(id);
        return HttpUtils.buildStringResponse("OK", HttpStatus.OK);
    }
}
